package com.yanqu.road.server.cmd.minewar.task;


import com.yanqu.road.pb.minewar.MineWarProto;
import com.yanqu.road.server.cmd.base.BaseTask;
import com.yanqu.road.server.gameplayer.GamePlayer;
import com.yanqu.road.server.manger.player.MineWarMgr;
import com.yanqu.road.message.YanQuMessage;
import com.yanqu.road.server.protocol.Protocol;

public class WithdrawPitTask extends BaseTask {

	private int mineType;

	private int pitId;

	public WithdrawPitTask(YanQuMessage packet, GamePlayer player) {
		super(packet, player);
	}

	@Override
	protected boolean parseData() throws Exception {
		MineWarProto.MinePitWithdrawReqMsg msg = MineWarProto.MinePitWithdrawReqMsg.parseFrom(packet.getBytes());
		mineType = msg.getMineType();
		pitId = msg.getPitId();
		return true;
	}

	@Override
	protected void execute() {
		player.sendPacket(Protocol.U_MINE_WAR_WITHDRAW_PIT, MineWarMgr.withdrawPit(player, mineType, pitId));
	}

	@Override
	protected void sendData(GamePlayer player) {

	}

}
